<?php

namespace IDock\Insurance\ZYIC\Request;

use IDock\Insurance\ZYIC\Request\AllZYICRequest;
use IDock\Insurance\ZYIC\Response\ProposalRecallResponse;
use IDock\Visitor\ProposalRecallVisitor;

class ProposalRecallRequest extends AllZYICRequest
{
    public $route = 'channelInterface/V29';

    protected $response = ProposalRecallResponse::class;

    protected $urlTip = '核保撤回';

    /**
     * @var  ProposalRecallVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        $arr = [
            'businessNo' => $this->visitor->biInquiryNo ?: $this->visitor->ciInquiryNo,
            'certiType' => 'T',
        ];
        if(!empty($this->visitor->biInquiryNo) && !empty($this->visitor->ciInquiryNo)){
            $arr = [
                'businessNo' => $this->visitor->biInquiryNo,
                'businessNoCI' => $this->visitor->ciInquiryNo,
                'certiType' => 'T',
            ];
        }
        return $arr;
    }
}
